package com.twt.controller;


import com.twt.entity.Result;
import com.twt.service.ThrowLakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ThrowLake")
public class ThrowLakeController {
    @Autowired
    private ThrowLakeService throwLakeService;

    /**
     * 投湖
     *
     * @param username,context 参数封装
     * @return Result
     */
    //http://localhost:8080/ThrowLake/throw?username=3020244106&context=你怎么说
    @PostMapping("/throw")
    public Result throwLake(@RequestParam("username") String username, @RequestParam("context") String context) {
        return throwLakeService.throwLake(username, context);
    }
}
